package me.tuyou.aop;

import me.tuyou.aop.bean.MyBean;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.context.annotation.EnableLoadTimeWeaving;

/**
 * @Description
 * @Author tuyou_cd
 * @Date 2020/5/28 14:08
 */
@EnableAspectJAutoProxy(exposeProxy = true, //向AopContext注册暴露
        proxyTargetClass = true) //使用cglib代理任何对象
@Configuration
//@EnableLoadTimeWeaving
public class App {

    public static void main(String[] args) {
        AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext("me.tuyou.aop");

        MyBean bean = applicationContext.getBean(MyBean.class);
        bean.test("tuyou", 30);
    }
}
